Repository navigation
extra/sysext: cut install tree - #2773
Conversation
| func (p *SysextTree) additionalRPMTransactions(installed rpmmd.PackageList) depsolvednf.TransactionList { | ||
| byNEVRA := make(map[string]rpmmd.Checksum, len(installed)) | ||
| for _, pkg := range installed { | ||
| byNEVRA[pkg.FullNEVRA()] = pkg.Checksum | ||
| } | ||
|
|
||
| transactions := make(depsolvednf.TransactionList, len(p.depsolveResult.Transactions)) | ||
| for i, transaction := range p.depsolveResult.Transactions { | ||
| for _, pkg := range transaction { | ||
| if checksum, ok := byNEVRA[pkg.FullNEVRA()]; ok && checksum == pkg.Checksum { | ||
| continue | ||
| } | ||
| transactions[i] = append(transactions[i], pkg) | ||
| } | ||
| } | ||
| return transactions | ||
| } |
There was a problem hiding this comment.
This got me thinking that the sysext transaction could be a separate one to begin with, right? Like if we add the sysext packages to the end of the depsolve chain as the last transaction, then that becomes the package list for the sysext (installable on top of the other transactions, which create the OS pipeline). So all this package filtering goes away.
What am I missing? Is it a problem with multiple sysexts?
There was a problem hiding this comment.
You're not missing anything here except my oversight. I think I pigeonholed myself into the result of the (already flattened) getPackageSetChains and maybe and older mental model of the depsolver where we might have not gotten the depsolve results back per transaction?
I'll adjust it to do them in a separate extension transaction and keep (most of the rest the same) so we don't need the funky filtering at all 🙂
The sysext extras by default already layered on top of the reference pipeline (usually the OS pipeline) for their RPM transaction. This means that the sysext installs *all* RPMs from the reference pipeline plus any additional ones. This was on purpose since it's easy to reason about and it shows that the naive implementation works. When `standalone` is turned on we don't do that and instead resolve the RPM transaction for the sysext separately. Change the default behavior for non-standalone sysexts to copy in the reference tree (so the RPM database and interpreters necessary for scriptlets are present) and then cut down the to-be-installed RPMs by tacking on an additional transaction and only putting those RPMs in the install. This really speeds up builds and due to the transaction nature of the depsolver we can guarantee that we can build on top of the reference pipeline in this way. Some numbers, for an image type that layers three sysexts (`podman`, `weechat`, and `tmux`): - Before: 7m08s total. - After: 4m13s total. The latter is basically the same time as the build without any system extensions. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
e9c3e28 to
76bdc95
Compare
|
Adjusted the PR to use a separate transaction. For some reason my brain thought we didn't get results for RPMs back per transaction ... even though I wrote code that iterated over the transactions 😬 |
The sysext extras by default already layered on top of the reference pipeline (usually the OS pipeline) for their RPM transaction. This means that the sysext installs all RPMs from the reference pipeline plus any additional ones. This was on purpose since it's easy to reason about and it shows that the naive implementation works.
When
standaloneis turned on we don't do that and instead resolve the RPM transaction for the sysext separately.Change the default behavior for non-standalone sysexts to copy in the reference tree (so the RPM database and interpreters necessary for scriptlets are present) and then cut down the to-be-installed RPMs by taking the subset of those that weren't already installed in the reference pipeline.
This really speeds up builds and due to the transaction nature of the depsolver we can guarantee that we can build on top of the reference pipeline in this way.
Some numbers, for an image type that layers three sysexts (
podman,weechat, andtmux):The latter is basically the same time as the build without any system extensions.